package cn.gson.fengboot.model.pojos;

import javax.persistence.*;
import java.util.Objects;

@Entity
public class Qpicture {
    private int pictureId;
    private Integer modelId;
    private String picturePath;
    private Qproductdetail prodetailId;

    @ManyToOne
    @JoinColumn(name = "prodetail_id")
    public Qproductdetail getProdetailId() {
        return prodetailId;
    }
    public void setProdetailId(Qproductdetail prodetailId) {
        this.prodetailId = prodetailId;
    }

    @Id
    @Column(name = "picture_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY,generator = "seq")
    public int getPictureId() {
        return pictureId;
    }

    public void setPictureId(int pictureId) {
        this.pictureId = pictureId;
    }

    @Basic
    @Column(name = "model_id")
    public Integer getModelId() {
        return modelId;
    }

    public void setModelId(Integer modelId) {
        this.modelId = modelId;
    }

    @Basic
    @Column(name = "picture_path")
    public String getPicturePath() {
        return picturePath;
    }

    public void setPicturePath(String picturePath) {
        this.picturePath = picturePath;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Qpicture qpicture = (Qpicture) o;
        return pictureId == qpicture.pictureId &&
                Objects.equals(modelId, qpicture.modelId) &&
                Objects.equals(picturePath, qpicture.picturePath);
    }

    @Override
    public int hashCode() {
        return Objects.hash(pictureId, modelId, picturePath);
    }
}
